<!DOCTYPE html>
<html>
	<head>
		<title>测试解析日期</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<script type="text/javascript" src="/js/jquery.jqplot.min.js"></script>
		<script type="text/javascript" src="http://i1.sinaimg.cn/jslib/jquery-1.4.2.min.js"></script>
	</head>
	<body>
		<div style="width: 966px; margin: 0 auto">
		<div style="width: 50%;float: left">
			<input id="inputContent" style="width: 100%;" class="gspeech" name="test" speech="speech" x-webkit-speech="x-webkit-speech" x-webkit-grammar="builtin:translate" />
			<input id="parse" type="button" value="解析" />
		</div>
		<div style="width: 49%;float: right">
			<ul id="result">
				<li />
			</ul>
		</div>
		</div>
		<script>
			$("#parse").click(function(){
				str = $("#inputContent").val();
				$.post('<?php echo WEBBASE_URL; ?>/accounts/testDateParseJson',{str:str},function(rtn){
					if(rtn){
						eval("var dates = "+rtn+";");
						if(dates.length){
							var dateStrs = [];
							for(i=0;i<dates.length;i++){
								a = dates[i].string+': '+dates[i].year;
								(typeof dates[i].month != 'undefined') && (a += '-'+dates[i].month);
								(typeof dates[i].day != 'undefined') && (a += '-'+dates[i].day);
								dateStrs.push(a);
							}
							
							$("#result").html('<li>'+dateStrs.join('</li><li>')+'</li>');
						}
					}
				});
			});
		</script>
	</body>
</html>

